#include "StdAfx.h"
#include "TGSvrNetCfg.h"


TGSvrNetCfg::TGSvrNetCfg(void)
{
	m_nDelayTimeKey2     =  10*1000;
	m_nDelayTimeKey      =  5*1000;
	m_nDelayTimeState16  =  600; 
	m_nDelayTimeState8   =  320;    
	m_nDelayTimeState4   =  160;    
	m_nDelayTimeState2   =  60;   

	m_nDownCodeRateTimes =  200;
	m_nUpCodeRateTimes   = -2000;

	m_nReference    = 16;   //16
	m_nReferenceV2  = 8;    //8
	m_nReferenceV3  = 2;    //2

	LoadCfg();
}


TGSvrNetCfg::~TGSvrNetCfg(void)
{
}

void TGSvrNetCfg::LoadCfg()
{
	char chFileName[MAX_PATH] = {0};
	sprintf(chFileName,".\\svr_net_cfg.ini");
	char szip[MAX_PATH] ={0};

	m_nDelayTimeKey2     = ::GetPrivateProfileInt("SVR_DelayTime","Key2",   10*1000, chFileName);  
	m_nDelayTimeKey      = ::GetPrivateProfileInt("SVR_DelayTime","Key",    5*1000,  chFileName);   
	m_nDelayTimeState16  = ::GetPrivateProfileInt("SVR_DelayTime","State16",600,     chFileName);
	m_nDelayTimeState8   = ::GetPrivateProfileInt("SVR_DelayTime","State8", 320,     chFileName);
	m_nDelayTimeState4   = ::GetPrivateProfileInt("SVR_DelayTime","State4", 160,     chFileName);
	m_nDelayTimeState2   = ::GetPrivateProfileInt("SVR_DelayTime","State2", 60,      chFileName);

	m_nDownCodeRateTimes  = ::GetPrivateProfileInt("SVR_CodeRateTimes","Down", 200,     chFileName);
	m_nUpCodeRateTimes    = ::GetPrivateProfileInt("SVR_CodeRateTimes","Up",   -2000,   chFileName);

	m_nReference    = ::GetPrivateProfileInt("SVR_Reference","V",  16,    chFileName);
	m_nReferenceV2  = ::GetPrivateProfileInt("SVR_Reference","V2", 8,     chFileName);
	m_nReferenceV3  = ::GetPrivateProfileInt("SVR_Reference","V3", 2,     chFileName);
}
